import 'package:dio/dio.dart';
import 'uidata.dart';

class DioHelper {
  static String BaseUrl = UIData.apiServer;

  static Future<Response> Post(String Url, dynamic data) async {
    var dio = new Dio();
    dio.options.baseUrl = BaseUrl;
    dio.options.headers['auth'] = UIData.token;
    Response response = await dio.post(Url, data: data);
    return response;
  }

  static Future<Response> Get(String Url, dynamic data) async {
    var dio = new Dio();

    dio.options.headers['auth'] = UIData.token;
    //print(UIData.token);
    dio.options.baseUrl = BaseUrl;
    Response response = await dio.get(Url);
    return response;
  }

  static Future<Response> Post2(
      String baseUrl, String Url, dynamic data) async {
    var dio = new Dio();
    dio.options.headers['auth'] = UIData.token;
    dio.options.baseUrl = baseUrl;
    Response response = await dio.post(Url, data: data);
    return response;
  }

  static Future<Response> Get2(String baseUrl, String Url, dynamic data) async {
    var dio = new Dio();
    dio.options.headers['auth'] = UIData.token;
    dio.options.baseUrl = baseUrl;
    Response response = await dio.get(Url);
    return response;
  }

  static Future<Response> Get3(String Url) async {
    final dio = new Dio();
    final response = await dio.get(Url);
    return response;
  }
}
